var form;
var table;
layui.use(['form','table'],function(){
    form = layui.form;
    table=layui.table;


});
//课程分类下拉菜单
$.ajax({
    url: "/SyOperationController/selCourseClassSelect",
    type: "get",
    dataType: "json",
    success: function (data) {
        for(var a=0;a<data.obj.length;a++){
            $("#class_id").append("<option value='"+data.obj[a].id+"'>"+data.obj[a].name+"</option>");
        }
    }
});

//确定查询
function selCourses() {

    var class_id=$("#class_id option:selected").val();
    var course_name=$("#course_name").val();
    var course_nprice=$("#course_nprice").val();
    var user_id=$("#user_id").val();
    var course_cstatus=$("#course_cstatus option:selected").val();
    var course_label=$("#course_label").val();


    parent.$("#class_id").val(class_id);
    parent.$("#course_name").val(course_name);
    parent.$("#course_nprice").val(course_nprice);
    parent.$("#user_id").val(user_id);
    parent.$("#course_cstatus").val(course_cstatus);
    parent.$("#course_label").val(course_label);

    parent.selCourses();

    //点击检索之后清空父子的输入框
    $("input").val("");
    $(this).find("option:selected").removeAttr("selected")
    parent.$("input").val("");
    parent.$(this).find("option:selected").removeAttr("selected");

    var layer_1=parent.layer_1;
    layer_1.close(layer_1.index);
};


//重置
function chongzhi(){
    $("input").val("");
    $(this).find("option:selected").removeAttr("selected");
}
